home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / IOInterface / windowDef.dcl < prev    next >
Encoding:
Modula Definition  |  1995-03-02  |  3.5 KB  |  82 lines  |  [TEXT/3PRM]

  1. definition module windowDef;
  2.  
  3. //    Version 0.8 to 1.0
  4.  
  5. //
  6. //    WindowDefinitions:
  7. //
  8.  
  9.  
  10. import    commonDef;
  11. from    deltaPicture import Picture, Rectangle, DrawFunction;
  12.  
  13.  
  14. ::    WindowDef *s *io
  15.     =    ScrollWindow    WindowId WindowPos WindowTitle
  16.                         ScrollBarDef ScrollBarDef
  17.                         PictureDomain MinimumWindowSize InitialWindowSize
  18.                         (UpdateFunction s) [WindowAttribute s io]
  19.     |    FixedWindow WindowId WindowPos WindowTitle
  20.                         PictureDomain (UpdateFunction s) [WindowAttribute s io];
  21.  
  22. ::    WindowId            :== Int;
  23. ::    WindowPos            :== (!Int, !Int);
  24. ::    WindowTitle            :== String;
  25. ::    ScrollBarDef        =    ScrollBar ThumbValue ScrollValue;
  26. ::    ThumbValue            =    Thumb  Int;
  27. ::    ScrollValue            =    Scroll Int;
  28. ::    MinimumWindowSize    :== (!Int, !Int);
  29. ::    InitialWindowSize    :== (!Int, !Int);
  30. ::    UpdateArea            :== [Rectangle];
  31. ::    UpdateFunction    *s    :== UpdateArea -> (s -> (s,[DrawFunction]));
  32.  
  33. ::    WindowAttribute    *s *io
  34.     =    Activate    (WindowFunction s io)
  35.     |    Deactivate    (WindowFunction s io)
  36.     |    GoAway        (WindowFunction s io)
  37.     |    Mouse        SelectState (MouseFunction s io)
  38.     |    Keyboard    SelectState (KeyboardFunction s io)
  39.     |    Cursor        CursorShape
  40.     |    StandByWindow;
  41.  
  42. ::    WindowFunction        *s *io :== s -> *(io -> (s, io));        
  43. ::    MouseFunction        *s *io :== MouseState    -> (s -> *(io -> (s, io)));
  44. ::    KeyboardFunction    *s *io :== KeyboardState-> (s -> *(io -> (s, io)));
  45.  
  46. ::    CursorShape    =    StandardCursor    | BusyCursor     | IBeamCursor
  47.                 |    CrossCursor        | FatCrossCursor | ArrowCursor | HiddenCursor;
  48.  
  49.  
  50. IsScrollWindow                    :: !(WindowDef s io) -> Bool;
  51. WindowDefGetWindowId            :: !(WindowDef s io) -> WindowId;
  52. WindowDefGetPosition            :: !(WindowDef s io) -> WindowPos;
  53. WindowDefGetTitle                :: !(WindowDef s io) -> String;
  54. WindowDefGetScrollBarDefs        :: !(WindowDef s io) -> (!ScrollBarDef, !ScrollBarDef);
  55. WindowDefGetPictureDomain        :: !(WindowDef s io) -> PictureDomain;
  56. WindowDefGetMinimumSize            :: !(WindowDef s io) -> MinimumWindowSize;
  57. WindowDefGetFinalMinimumSize    :: !(WindowDef s io) -> MinimumWindowSize;
  58. WindowDefGetInitialSize            :: !(WindowDef s io) -> InitialWindowSize;
  59. WindowDefGetUpdate                :: !(WindowDef s io) -> UpdateFunction s;
  60.  
  61. WindowDefHasAttribute            :: !(WindowDef s io) !(WindowAttribute s io) -> Bool;
  62. WindowDefIsStandBy                :: !(WindowDef s io) -> Bool;
  63. WindowDefGetActivate            :: !(WindowDef s io) -> WindowFunction s io;
  64. WindowDefGetDeactivate            :: !(WindowDef s io) -> WindowFunction s io;
  65. WindowDefGetGoAway                :: !(WindowDef s io) -> WindowFunction s io;
  66. WindowDefGetCursor                :: !(WindowDef s io) -> CursorShape;
  67. WindowDefGetKeyboard            :: !(WindowDef s io) -> (!SelectState, !KeyboardFunction s io);
  68. WindowDefGetMouse                :: !(WindowDef s io) -> (!SelectState, !MouseFunction s io);
  69.  
  70. ScrollBarDefGetValues            :: !ScrollBarDef -> (!Int, !Int);
  71.  
  72. WindowDefSetPictureDomain        :: !PictureDomain                    !(WindowDef s io) -> WindowDef s io;
  73. WindowDefSetUpdate                :: !(UpdateFunction s)                !(WindowDef s io) -> WindowDef s io;
  74. WindowDefSetActivate            :: !(WindowFunction s io)            !(WindowDef s io) -> WindowDef s io;
  75. WindowDefSetDeactivate            :: !(WindowFunction s io)            !(WindowDef s io) -> WindowDef s io;
  76. WindowDefSetGoAway                :: !(WindowFunction s io)            !(WindowDef s io) -> WindowDef s io;
  77. WindowDefSetScrollBarDefs        :: !(!(!Int,!Int), !(!Int,!Int))    !(WindowDef s io) -> WindowDef s io;
  78. WindowDefSetMinimumSize            :: !MinimumWindowSize                !(WindowDef s io) -> WindowDef s io;
  79. WindowDefSetCursor                :: !CursorShape                        !(WindowDef s io) -> WindowDef s io;
  80. WindowDefSetKeyboard            :: !SelectState !(KeyboardFunction s io) !(WindowDef s io) -> WindowDef s io;
  81. WindowDefSetMouse                :: !SelectState !(MouseFunction    s io) !(WindowDef s io) -> WindowDef s io;